package dynamic_programming;
//https://leetcode.cn/leetbook/read/illustration-of-algorithm/50fxu1/
public class LCR_126斐波那契数 {
    class Solution {
        public int fib(int n) {
            if(n == 0) return 0;
            int a = 0, b = 1, sum;
            for(int i = 0; i < n; i++){
                sum = (a + b) % 1000000007;
                a = b;
                b = sum;
            }
            return a;
        }
    }
}
